package gameevent

import "xr-game-server/core/event"

const (
	LvAddEvent     event.Type = "LvAddEvent"
	ExpAddEvent    event.Type = "ExpAddEvent"
	LvReduceEvent  event.Type = "LvReduceEvent"
	ExpReduceEvent event.Type = "ExpReduceEvent"
)

type LvAddEventData struct {
	RoleId uint64 `json:"-"`
	OldLv  uint64 `json:"oldLv" dc:"旧等级"`
	NewLv  uint64 `json:"newLv" dc:"新等级"`
}

type LvReduceEventData struct {
	RoleId uint64
	OldLv  uint64
	NewLv  uint64
}

func NewLvReduceEvent(roleId uint64, oldLv, newLv uint64) *LvReduceEventData {
	return &LvReduceEventData{
		RoleId: roleId,
		OldLv:  oldLv,
		NewLv:  newLv,
	}
}

func NewLvAddEventData(roleId uint64, oldLv, newLv uint64) *LvAddEventData {
	return &LvAddEventData{
		RoleId: roleId,
		OldLv:  oldLv,
		NewLv:  newLv,
	}
}

type ExpAddEventData struct {
	RoleId uint64 `json:"-"`
	OldExp uint64 `json:"oldExp" dc:"旧经验"`
	NewExp uint64 `json:"newExp" dc:"新经验"`
}

type ExpReduceEventData struct {
	RoleId uint64
	OldExp uint64
	NewExp uint64
}

func NewExpReduceEventData(roleId uint64, oldExp, newExp uint64) *ExpReduceEventData {
	return &ExpReduceEventData{
		RoleId: roleId,
		OldExp: oldExp,
		NewExp: newExp,
	}
}

func NewExpAddEventData(roleId uint64, oldExp, newExp uint64) *ExpAddEventData {
	return &ExpAddEventData{
		RoleId: roleId,
		OldExp: oldExp,
		NewExp: newExp,
	}
}
